package com.weng.bigdata.core.warehouse.enums;

/*
 *  数据库存储类型枚举
 * @author wengzhonghui
 * @date 17:02 2019/9/25
 */

public enum StoredFormatTypeEnum {

    TEXTFILE("TEXTFILE"),
    AVRO("AVRO"),
    RCFILE("RCFILE"),
    ORCFILE("ORCFILE");


    private String format;

    StoredFormatTypeEnum(final String format) {
        this.format = format;
    }

    public String getName() {
        return name();
    }

    public String getValue() {
        return format;
    }

    public static StoredFormatTypeEnum valueOfFormat(String format) {
        for( StoredFormatTypeEnum sqlType : StoredFormatTypeEnum.class.getEnumConstants()) {
            if(sqlType.format.equalsIgnoreCase(format))
                return sqlType;
        }
        throw new IllegalArgumentException("format:" + format + " is not a valid ");
    }
}
